soxfandomcom-20200214-history
FILENAMES
FILENAMES Filenames can be simple file names, absolute or relative path names, or URLs (input files only). Note that URL support requires that wget(1) is available. Note: Giving SoX an input or output filename that is the same as a SoX effect-name will not work since SoX will treat it as an effect specification. The only work-around to this is to avoid such filenames. This is generally not difficult since most audio filenames have a filename ‘extension’, whilst effect-names do not. Special Filenames The following special filenames may be used in certain circumstances in place of a normal filename on the command line: "|program [options] ..."' This can be used in place of an input filename to specify the the given program’s standard output (stdout) be used as an input file. Unlike '− (above), this can be used for several inputs to one SoX command. For example, if ‘genw’ generates mono WAV formatted signals to its standard output, then the following command makes a stereo file from two generated signals: sox −M "|genw −−imd −" "|genw −−thd −" out.wav For headerless (raw) audio, −t (and perhaps other format options) will need to be given, preceding the input command. "''wildcard-filename''" Specifies that filename ‘globbing’ (wild-card matching) should be performed by SoX instead of by the shell. This allows a single set of file options to be applied to a group of files. For example, if the current directory contains three ‘vox’ files, file1.vox, file2.vox, and file3.vox, then play −−rate 6k *.vox will be expanded by the ‘shell’ (in most environments) to play −−rate 6k file1.vox file2.vox file3.vox which will treat only the first vox file as having a sample rate of 6k. With play −−rate 6k "*.vox" the given sample rate option will be applied to all three vox files. −p, −−sox−pipe This can be used in place of an output filename to specify that the SoX command should be used as in input pipe to another SoX command. For example, the command: play "|sox −n −p synth 2" "|sox −n −p synth 2 tremolo 10" stat plays two ‘files’ in succession, each with different effects. −p is in fact an alias for ‘'−t sox −'’. −d, −−default−device This can be used in place of an input or output filename to specify that the default audio device (if one has been built into SoX) is to be used. This is akin to invoking rec or play (as described above). −n, −−null This can be used in place of an input or output filename to specify that a ‘null file’ is to be used. Note that here, ‘null file’ refers to a SoX-specific mechanism and is not related to any operating-system mechanism with a similar name. Using a null file to input audio is equivalent to using a normal audio file that contains an infinite amount of silence, and as such is not generally useful unless used with an effect that specifies a finite time length (such as trim or synth). Using a null file to output audio amounts to discarding the audio and is useful mainly with effects that produce information about the audio instead of affecting it (such as noiseprof or stat). The sampling rate associated with a null file is by default 48 kHz, but, as with a normal file, this can be overridden if desired using command-line format options (see below). Supported File & Audio Device Types See soxformat(7) for a list and description of the supported file formats and audio device drivers.